package com.mall.db.service;

import com.mall.db.dao.ScheduleDao;
import com.mall.db.domain.Schedule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchedulerService {

    @Autowired
    private ScheduleDao jd;


    public List<Schedule> find(){
        return jd.find(new Schedule());
    }

    public Schedule getByJobName(String jobName){
        Schedule jt = new Schedule();
        jt.setJobName(jobName);
        List<Schedule> list = jd.find(jt);
        return list.size()>0?list.get(0):null;
    }

}
